package cn.com.headfree.salary.service.impl;

import cn.com.headfree.entity.TSalaryHandle;
import cn.com.headfree.entity.TSeniorTechnicianHandle;
import cn.com.headfree.salary.dao.TSalaryHandleDao;
import cn.com.headfree.salary.service.TSalaryHandleService;
import com.gta.edu.sdk.util.IdGen;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;


@Service("tSalaryHandleService")
public class TSalaryHandleServiceImpl implements TSalaryHandleService {

	@Autowired
	private TSalaryHandleDao tSalaryHandleDao;

	@Override
	public void solveData(String erpNo,String id, String isHide,String seniorId) {
		TSalaryHandle handle = new TSalaryHandle();
		if(isHide.equals("0")){//由可见变隐藏
			handle.setId(IdGen.uuid());
			handle.setErpNo(erpNo);
			handle.setBusinessId(id);//业务表ID
			handle.setSalaryId(seniorId);//薪档调整表ID
			handle.setIsHide(isHide);
			handle.setCreaterId(erpNo);
			handle.setCreateTime(new Date());
			tSalaryHandleDao.saveInfo(handle);
		}else{//由隐藏变可见
			handle.setBusinessId(id);
			handle.setErpNo(erpNo);
			tSalaryHandleDao.deleteInfo(handle);
		}
	}
}
